package com.itheima.Test002;
//这是一个测试类;
public class Demo {
    public static void main(String[] args) {
        //使用Student类来创建一个对象;
        Student student = new Student();
        method(student);
        person person = new person() {
            @Override
            public void eat() {
                System.out.println("匿名内部类第一种写法");
            }
        };
        method(person);
        method(new person() {
            @Override
            public void eat() {
                System.out.println("匿名内部类第二种写法");
            }
        });


    }
    public static  void method(person person){
        System.out.println("看看人是怎么吃饭的");
        person.eat();

    }
}
